import "./assets/main.css";

import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
//导入element
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
// 导入图标按需引入
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 导入过滤器
import filters from "./filter";

const app = createApp(App);
app.use(createPinia());
app.use(router);
app.use(ElementPlus);

// 按需引入element图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 注册全局过滤去
for (const [key, value] of Object.entries(filters)) {
  app.config.globalProperties[key] = value;
}

app.mount("#app");
